<?php
namespace Cyfy\Modules\Videos\Forms;
use \Cyfy\Modules\Forms;

class Edit extends Add
{
    function submit()
    {
        $assoc = array(
            'uid' => \Cyfy\Modules\Users\Current :: $uid,
            'time' => new \datetime(),
            'type' =>  $this -> vid["type"],
            'value' =>  $this -> vid["value"],
            'title' => $this -> get('title'),
            'description' => $this -> get('description'),
        );
        
        \dibi :: query("UPDATE [:cyfy:Videos] SET %a ", $assoc, " WHERE vid = %i", $this->getTemp("vid"));
        
        \Cyfy\Message::Set(self :: t(70));
        $this -> onSubmit = "Cyfy.ajax('Videos', 'getVideo', '#videoFrame-" . $this->getTemp("vid") . "', 'vid=" . $this -> getTemp("vid") . "');";
        return true;
    }
}